<template>
  <div class="hello">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span> {{demoList.desc}}</span>
      </div>
      <el-table
          size="mini"
          :data="tableData"
          style="width: 100%">
        <el-table-column prop="publisher" label="出版社"></el-table-column>
        <el-table-column prop="title" label="标题"></el-table-column>
        <el-table-column prop="translator" label="翻译"></el-table-column>
        <el-table-column prop="price" label="价格"></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {
    name: 'HelloWorld',
    props: ['openData', 'ssssssssssss'],
    data() {
      return {
        tableData: [],
        demoList: {},
      }
    },
    created() {
      let vm = this

      // // mock get 假数据
      axios.get(`/api/mock/booklist?type=1`).then(res => {
        console.log('书籍列表：',res);
        vm.tableData = res.data.data.lists
      }).catch(error=>{
        console.log(error);
      });

      // mock post 假数据
      axios.post(`/api/mock/school`, { params: 1 }).then(res => {
        vm.demoList = res.data.data
      }).catch(error=>{
        console.log(error);
      });
    },
    methods: {
      close () {
        this.emit('close')
      }
    }
  }
</script>

<style scoped>
</style>
